package com.itzhoun.vo;

import com.itzhoun.annotation.IdCard;
import com.itzhoun.groups.AgeGroups;
import com.itzhoun.groups.UserGroups;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author 周楠
 * @Date 2022/06/28/下午 11:12
 */
@Data
public class UserVO implements Serializable {

    private static final long serialVersionUID = -6189402635833626632L;

    /**
     * 字符串类型对应哪个参数能够实现
     * 一般来说
     * @NotEmpty 用在集合类上面
     * @NotBlank 用在String上面
     * @NotNull 用在基本类型上面
     */
    @NotBlank(message = "用户名称不能为空 notBlank",groups = UserGroups.class)
    private String username;

    @Email(message = "邮箱格式错误",groups = UserGroups.class)
    private String email;

    @IdCard(groups = UserGroups.class)
    private String idCard;

    @NotNull(message = "年龄不能为空",groups = AgeGroups.class)
    private Integer age;


}
